home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / DEMONSTR / ATEASY_2.ZIP / ATEASYDL.PAS < prev    next >
Pascal/Delphi Source File  |  1993-08-01  |  6KB  |  162 lines

  1. {****************************************************************************
  2. *                                                                           *
  3. *                    Include File For Writing                               *
  4. *                                                                           *
  5. *             ATEASY Dynamic Link Library, version 2.00                     *
  6. *                                                                           *
  7. *                   for Turbo Pascal for Windows                            *
  8. *                                                                           *
  9. *                            June 1993                                      *
  10. *                                                                           *
  11. *                                                                           *
  12. *                                                                           *
  13. *                    Copyright 1991-1993 GEOTEST Inc.                       *
  14. *                                                                           *
  15. *                          By:  Ronnie Yazma                                *
  16. *                                                                           *
  17. ****************************************************************************}
  18.  
  19. {******************************************************************************
  20.             A T E A S Y D L . pas
  21. ******************************************************************************}
  22.  
  23. {  This file contains type definition for parameters passed by ATEasy
  24.    to a ATEasy type DLL subroutines.
  25.    Note that ATEasy v2.0 supports also None ATEasy type DLLs which are similar to
  26.    normal 'C' like DLL.
  27.    
  28.    ATEasy type DLL 'knows' two types of subroutines:
  29.  
  30.        1) DLL subroutine that defined in the Driver Editor 'DLL Subroutines',
  31.           this subroutine can have various parameters defined in the Variables
  32.           Window. A general definition of that subroutine is:
  33.  
  34.           VOID _CALLBACK DLLSubroutine(hWnd [,parameters...]);
  35.  
  36.           where [,parameters...] is optional.
  37.  
  38.           Parameters definitions type are followed here, two types exist VAR
  39.           and VAL. For example if You define an ATEASY DLL subroutine:
  40.  
  41.           Sub(VAL string A, VAL Int B, VAR Int C)
  42.  
  43.           The DLL subroutine should look like:
  44.  
  45.           procedure Sub(HWND: hWnd; A: VAL_ASTRING; B: VAL_INT; C: VAR_INT);export;
  46.           begin
  47.           end;
  48.           
  49.           If you declare a function in ATEasy the return value is like C:
  50.           
  51.           String Function(VAL String A)
  52.           
  53.           The DLL function should declared as:
  54.           
  55.           function(HWND: hWnd; A: VAL_ASTRING):^char; export;
  56.           begin
  57.           end;
  58.  
  59.           and the function should return a pointer to a null terminated string (ASCIIZ).
  60.  
  61.        2) Interface Sub. Defined in the Driver Editor 'Call Interface Sub'.
  62.       This subroutine have a fixed format defined as:
  63.  
  64.       function InterfaceSubName(lpii : LPINTERFACEINFO):integer;export;
  65.           begin
  66.           end;
  67.  
  68. }
  69.  
  70. {******************************************************************************
  71.             D L L   paramaters type definition
  72. ******************************************************************************}
  73.  
  74. type
  75.  
  76. { VAL parameters type definition }
  77.  
  78.     VAL_BYTE  = char;
  79.     VAL_INT   = integer;
  80.     VAL_LONG  = longint;
  81.     VAL_FLOAT = double;
  82.  
  83. { VAR parameter type definition }
  84.  
  85.     VAR_BYTE  = ^char;       { Note you can use pascal keyword 'var' instead of '^'}
  86.     VAR_INT   = ^integer;
  87.     VAR_LONG  = ^longint;
  88.     VAR_FLOAT = ^double;
  89.  
  90.  
  91. { VAL/VAR Array parameters type definition }
  92.  
  93.     _ABYTE = array [1..32767] of char;
  94.     _AINT  = array [1..16383] of integer;
  95.     _ALONG = array [1..8191] of longint;
  96.     _AFLOAT= array [1..4095] of double;
  97.     _ASTRING = record
  98.             nLen : integer;
  99.             lp   : array [1.. 32767] of char;
  100.     end;
  101.  
  102.     _ABYTE_RECORD = record
  103.             lpByte : ^_ABYTE;
  104.             nDim1  : integer;
  105.             nDim2  : integer;
  106.     end;
  107.     VAL_ABYTE = ^_ABYTE_RECORD;
  108.     VAR_ABYTE = VAL_ABYTE;   { Note VAR & VAL are the same for array}
  109.  
  110.     _AINT_RECORD = record
  111.             lpInt : ^_AINT;
  112.             nDim1 : integer;
  113.             nDim2 : integer;
  114.     end;
  115.     VAL_AINT = ^_AINT_RECORD;
  116.     VAR_AINT = VAL_AINT;
  117.  
  118.     _ALONG_RECORD = record
  119.             lpLong : ^_ALONG;
  120.             nDim1  : integer;
  121.             nDim2  : integer;
  122.     end;
  123.     VAL_ALONG = ^_ALONG_RECORD;
  124.     VAR_ALONG = VAL_ALONG;
  125.  
  126.     _AFLOAT_RECORD = record
  127.             lpFloat : ^_AFLOAT;
  128.             nDim1   : integer;
  129.             nDim2   : integer;
  130.     end;
  131.     VAL_AFLOAT = ^_AFLOAT_RECORD;
  132.     VAR_AFLOAT = VAL_AFLOAT;
  133.  
  134.     _ASTRING_RECORD = record
  135.             lpString : ^_ASTRING;
  136.             nDim1    : integer;
  137.             nDim2    : integer;
  138.     end;
  139.     VAL_ASTRING = ^_ASTRING_RECORD;
  140.     VAR_ASTRING = VAL_ASTRING;
  141.  
  142.  
  143. {******************************************************************************
  144.            Interface Sub parameter definition
  145. ******************************************************************************}
  146.  
  147.     INTERFACEINFO = record
  148.         szDRVName   : array [1..22] of char;   { the name of the driver }
  149.         nDRVType    : integer;                 { the type: 1-GPIB, 2-RS232, 3-VXI(MXI), 4-OTHER }
  150.         lDRVAddress : longint;                 { address handle of the driver (can be use to access
  151.                                                  low-level communication functions }
  152.  
  153.         szCommand   : array [1..512] of char;  { the current command without parameters }
  154.  
  155.         szExtra     : array [1..32] of char;   { reserved }
  156.     end;
  157.     LPINTERFACEINFO = ^INTERFACEINFO;
  158.  
  159. {******************************************************************************
  160.            E - O - F
  161. ******************************************************************************}
  162.